package com.lagou.domain;

import java.util.List;

public class Article {

    private Integer id;
    private String title;
    private String content;

    //一对多关系 一篇文章有多个评论  用集合:代表了当前文章下的评论 collection
    //从一方实体中想表示多方关系就用集合
    private List<Comment> commentsList;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<Comment> getCommentsList() {
        return commentsList;
    }

    public void setCommentsList(List<Comment> commentsList) {
        this.commentsList = commentsList;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", commentsList=" + commentsList +
                '}';
    }
}
